<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<title>コントロールパネル</title>
		<link rel="stylesheet" href="./assets/styles/default.css" type="text/css" />
		<link rel="stylesheet" type="text/css" href="./assets/styles/tablesorter.css" />
		<link rel="stylesheet" href="./assets/styles/ui-lightness/ui.all.css" type="text/css" />
		<link type="text/css" href="./assets/styles/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
		<link rel="stylesheet" href="./assets/styles/dialog.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/importing.css" type="text/css" />
		<script src="assets/scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script src="assets/scripts/jquery-ui-1.7.3.custom.min.js" type="text/javascript"></script>
		<script src="assets/scripts/ui/ui.dialog.js" type="text/javascript"></script>
		<script src="assets/scripts/menu.js" type="text/javascript"></script>
		<script src="assets/scripts/table.js" type="text/javascript"></script>
		<script type="text/javascript" src="./tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
		<script type="text/javascript" src="./assets/scripts/editor.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.datepicker.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.core.js"></script>
		<script type="text/javascript" src="./assets/scripts/search.js"></script>
		<script type="text/javascript" src="./assets/scripts/tablesorter.js"></script>
		<script type="text/javascript" src="./assets/scripts/import.js"></script>
		<script type="text/javascript">
		$(function() {
			$('.message').fadeIn("slow");
			$('.text_date').datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'yy/mm/dd'
			});
			$('#btn-importr').click(function(){	
				var thesort = $('input:radio[name="sort"]:checked').val() ;
				
				if ($('#matrix_cd').val() == "" ) {
					alert("週を選択してください");
					return false;
				}
				if ((thesort ==1) || (thesort == 2) || (thesort == 3) ) {
					$('#layerzuo').fadeIn()
				}
				/*
				if (thesort ==3){
					$matrix_cd
				}
				*/
				//document.fm.action = "user_importing.php";
				document.fm.target = "i_frame";
				document.fm.submit();
			});
			
			$('#btn-reset1').click(function(){	
				location.href = document.form1.action;
			});
			
			$('#btn_search1').click(function(){	
				document.form1.csv.value="";
				document.form1.submit();
			});
			
			$('#year4').change(function(){
				var year4 = this.value;
				var myDate = new Date();
				var nowtime =  myDate.getTime();
				$.get("mmap_week_ajax.php",{ y: year4,t : nowtime }, function(data){
					$("#matrix_cd").children().remove();
					$("#matrix_cd").append( data ); 
				});
			});
			$('#dialogdetail').dialog({
			    autoOpen: false,
			    width: 700,
			    height:450,
			    title: '履歴詳細',
			    modal:true,
			    resizable:false,
			    buttons: {
			    "閉じる": function() {
			    $('#dialogdetail').innerHTML ="";
			   	 $(this).dialog("close");
			    }
			 }
			});
		});
		function toPage(thepage) {
			document.form1.page.value =  thepage;
			document.form1.csv.value="";
			document.form1.submit();
		}
		function gotoshow(id) {
			var urlPara = "mrhizome_detail.php?id=" + id;
			var myDate = new Date();
			urlPara = urlPara + "&s=" + myDate.getTime(); 
			$("#dialogdetail").load( urlPara ).dialog({
				modal:true
			}); 
			$('#dialogdetail').dialog('open');
			
		}
		</script>
	</head>
	<body id="">
{{$menu}}
{{$logout}}
		<div id="container"><div class="wrapper">
			<h2>リゾーム履歴マスター管理</h2>
			<ul class="submenu clearfix">
				<li>リゾーム履歴情報一覧</li>
				li><a href="mrhizome_qrs_dm.php">チラシDM連携ファイル出力</a></li>
			</ul>
			<h3>リゾーム履歴情報一覧</h3>

		<form  id="fmfile" name="fm" method="post"  action="mrhizome_exec.php" enctype="multipart/form-data" >
				<table class="formTable">
					<tbody>
						<tr><th>週</th><td>
{{ html_options id='year4' name='year4' options=$year4 selected=$forms.year4 }} 年 {{ html_options id='matrix_cd' name='matrix_cd' options=$week  selected=$forms.matrix_cd }} 
							</td><th>種類</th>
							<td> {{ html_radios  id="sortr" name='sort' options=$sorts selected=$forms.sort separator='&nbsp;' }}</td>
							<td>
								&nbsp;&nbsp;<button type="button" id="btn-importr" class="submit"><span>&nbsp;&nbsp;実行&nbsp;</span></button>
							</td>
							</tr>
					</tbody>
				</table>
			</form>
			<form name="form1" id="form1" method="get" action="mrhizome_index.php" >
				<input type="hidden" name="page" />
				<table class="formTable">
					<tbody>
						<tr>
							<th>種類</th>
							<td>
								{{ html_radios  name='sort' options=$sorts selected=$forms.sort separator='&nbsp;' }}
							</td>
						</tr>
						<!--  	<tr>
							<th>更新日</th>
							<td colspan=3>
								<input type="text" name="upd_f" class="text_date" value="{{ $forms.upd_f }}" /> ～ 
								<input type="text" name="upd_t" class="text_date" value="{{ $forms.upd_t }}" />
							</td>
						</tr>
						-->
					</tbody>
				</table>
				<p class="button" style="text-align:right">
					<button type="button" id="btn-reset1"><span>クリア</span></button>
					<button type="button" id="btn_search1" class="submit"><span>絞込検索</span></button>
				</p>
				<input type="hidden" name="search" value="1" />
				<input type="hidden" name="csv" />
			</form>
{{ if is_numeric($page.cnt) }}
{{ if $page.cnt > 0 }}
			<p class="message">{{ $page.cnt }}件の情報が見つかりました。</p>
			<p align="left">{{$pageing}}</p>
			<table id="search_result" class="sortable">
				<thead>
					<tr>
						<th><h3>マトリックスコード</h3></th>
						<th><h3>種類</h3></th>
						<th><h3>処理開始時間</h3></th>
						<th><h3>処理終了時間</h3></th>
						<th><h3>処理結果</h3></th>
						<th><h3>更新日時</h3></th>
						<th><h3>更新者</h3></th>
						<th><h3>操作</h3></th>
					</tr>
				</thead>
				<tbody>
{{ foreach from=$data key=k item=v name="member" }}
					<tr class="{{cycle values=odd,mod name='member'}}">
						<td>{{ $v.matrix_cd }}</td>
						<td>{{ $sorts[$v.sort] }}</td>
						<td class="center">{{ $v.start_time|date_format:"%Y/%m/%d %H:%M:%S" }}</td>
						<td class="center">{{ $v.end_time|date_format:"%Y/%m/%d %H:%M:%S" }}</td>
						<td>{{ $rests[$v.result_flg] }}</td>
						<td class="center">{{ $v.u_time|date_format:"%Y/%m/%d %H:%M" }}</td>
						<td >{{ $v.u_user }}</td>
						<td class="center"><a href="javascript:void(0)" onclick="javascript:gotoshow({{$v.id}});">[詳細]</a></td>
					</tr>
{{ /foreach }}
				</tbody>
			</table>
			<p align="right">{{$pageing}}</p>

<div id="dialogdetail" >
</div>
{{ else }}
<p class="message">条件にマッチする情報は見つかりませんでした。</p>
{{ /if }}
{{ else }}
	<p class="message">ここに検索結果が表示されます。</p>
{{ /if }}
		</div></div>
		{{ $import }}
		{{ $footer }}
	</body>
</html>